Aim (grant application)

The aim of this project is to develop a generic dashboard, e.g. a R shiny application to 1) inspect model inputs and outputs, 2) visualise the original inputs and outputs, 3) investigate the relationship between model inputs and outputs through metamodelling and data visualisation methods, 4) save the performed analyses.

For info

Package with supporting functions can be found here: https://github.com/Xa4P/pacheck.
This App should focus on validation of the health economic model (using the probabilistic inputs/ outputs).

Structure shiny app

The envisoned R Shiny app will have the following tabs. I’ve developed some functions which are ready to be implemented. Currently, I’ve only considered 2 strategies (“intervention” (_in) and “comparator” (_comp)). What is shown in this document is based on the probabilistic analysis of a (toy) 3-states Health State Transition Model (Progression-free (PF), Progressed disease (PD), Dead (D)) depicted in Figure 1. The intervention is only having an effect on the probability of progression, and incurs costs in the Progression-Free health state.

Karel: elke cijfer is een aparte tab van de app.

1. Upload of original health economic model inputs and outputs

Content:

  • Welcome message
  • Instructions
  • Upload 1 file with inputs and outputs (or 2? inputs and outputs separately?)
  • Select variables representing total costs and effects for each strategy (to calculate increments and (incremental) net benefits)
df_pa <- calculate_nb(df = df_pa,
                      e_int = "QALY_int",
                      e_comp = "QALY_comp",
                      c_int = "Costs_int",
                      c_comp = "Costs_comp",
                      wtp = 80000)# calculate net benefits

2. Investigate model inputs and outputs

a. Summary statistics of (user-selected) model inputs and outputs

To examine whether cost inputs are always positive for instance

df <- generate_sum_stats(df_pa)
kable(df)
Parameter Mean SD Percentile_2.5th Percentile_97.5th Minimum Maximum
p_pfspd 0.150 0.035 0.088 0.226 0.049 0.316
p_pfsd 0.100 0.030 0.049 0.165 0.023 0.244
p_pdd 0.201 0.040 0.129 0.283 0.073 0.366
p_dd 1.000 0.000 1.000 1.000 1.000 1.000
p_ae 0.050 0.022 0.016 0.099 0.003 0.150
rr 0.752 0.067 0.631 0.895 0.541 1.053
u_pfs 0.750 0.070 0.601 0.872 0.452 0.938
u_pd 0.551 0.101 0.351 0.743 0.189 0.880
u_d 0.000 0.000 0.000 0.000 0.000 0.000
u_ae 0.150 0.050 0.067 0.260 0.027 0.381
c_pfs 1001.901 198.469 618.721 1394.938 251.129 1683.865
c_pd 2001.849 401.590 1206.941 2797.130 507.164 3473.235
c_d 0.000 0.000 0.000 0.000 0.000 0.000
c_thx 9998.458 98.509 9803.697 10189.988 9645.508 10432.360
c_ae 500.147 98.550 326.356 713.320 202.776 973.505
QALY_comp 3.712 0.708 2.507 5.254 1.766 7.250
QALY_int 3.981 0.783 2.653 5.680 1.884 7.814
Costs_comp 7245.761 1569.069 4537.692 10630.767 2839.705 16238.254
Costs_int 38854.361 7228.899 26648.057 54604.712 20429.429 76463.167
LY_pfs_comp 2.933 0.659 1.871 4.453 1.387 6.718
LY_pfs_int 3.536 0.791 2.254 5.327 1.610 7.865
LY_pd_comp 2.741 0.682 1.610 4.282 0.901 7.703
LY_pd_int 2.422 0.650 1.351 3.879 0.765 7.287
QALY_pfs_comp 2.200 0.539 1.342 3.437 0.924 5.179
QALY_pfs_int 2.653 0.647 1.615 4.127 1.018 6.195
QALY_pd_comp 1.512 0.476 0.753 2.606 0.411 4.629
QALY_pd_int 1.336 0.443 0.636 2.359 0.311 4.062
Costs_pfs_comp 2671.516 775.772 1398.436 4432.004 521.298 7716.981
Costs_pfs_int 3177.110 912.998 1677.048 5233.989 648.519 8584.097
Costs_pd_comp 4574.245 1424.259 2228.701 7800.942 896.710 13727.249
Costs_pd_int 3991.423 1308.219 1879.682 6956.242 761.653 12828.864
QALY_ae_int 0.007 0.004 0.002 0.018 0.000 0.040
Costs_ae_int 24.903 12.074 7.479 53.808 1.374 91.560
Inc_QALY 0.269 0.158 0.033 0.646 -0.104 1.354
Inc_Costs 31608.600 6585.818 20607.829 46205.934 14878.338 65705.370
NMB_int 279632.263 56982.507 183219.889 403404.370 127992.478 568499.061
NMB_comp 289739.318 55800.494 194916.374 411412.957 137320.155 570174.142
iNMB -10107.055 9812.155 -26482.834 12108.532 -42289.220 52160.541
NHB_int 3.495 0.712 2.290 5.043 1.600 7.106
NHB_comp 3.622 0.698 2.436 5.143 1.717 7.127
iNHB -0.126 0.123 -0.331 0.151 -0.529 0.652
rm(df)

b. Correlation matrix inputs (and outputs)

Question Karel:
- kan dit met kleuren om de sterke van de associatie te onderbouwen?

generate_cor(df_pa)
## Warning in cor(df): the standard deviation is zero
##                     p_pfspd       p_pfsd        p_pdd p_dd          p_ae
## p_pfspd         1.000000000 -0.139033305 -0.010495755   NA -0.0302428377
## p_pfsd         -0.139033305  1.000000000 -0.010816151   NA -0.0036632638
## p_pdd          -0.010495755 -0.010816151  1.000000000   NA  0.0017019827
## p_dd                     NA           NA           NA    1            NA
## p_ae           -0.030242838 -0.003663264  0.001701983   NA  1.0000000000
## rr              0.005555683  0.006708217 -0.005797883   NA  0.0076915659
## u_pfs          -0.003437065  0.009789630 -0.016799074   NA -0.0114845290
## u_pd           -0.008489360 -0.010290774 -0.014401764   NA  0.0042858245
## u_d                      NA           NA           NA   NA            NA
## u_ae            0.004214310 -0.007845934  0.006115386   NA -0.0207283208
## c_pfs          -0.007240729  0.008922006  0.007699470   NA  0.0116018262
## c_pd           -0.006491644 -0.001989455  0.004018725   NA -0.0029725655
## c_d                      NA           NA           NA   NA            NA
## c_thx          -0.009512600  0.003227603 -0.006967529   NA -0.0063313753
## c_ae           -0.004787715 -0.020918854  0.008406508   NA -0.0018542748
## QALY_comp      -0.245500974 -0.650125556 -0.389887645   NA  0.0089054634
## QALY_int       -0.217456717 -0.721315789 -0.308303151   NA  0.0038105146
## Costs_comp      0.116309363 -0.524992861 -0.466695171   NA -0.0003802565
## Costs_int      -0.512223757 -0.709963006 -0.071951283   NA  0.0194901707
## LY_pfs_comp    -0.709945440 -0.562256166  0.016256423   NA  0.0279916020
## LY_pfs_int     -0.595708606 -0.643733642  0.017622636   NA  0.0232828300
## LY_pd_comp      0.478324088 -0.483203573 -0.732087372   NA -0.0145949890
## LY_pd_int       0.518747045 -0.509285887 -0.676112095   NA -0.0142772713
## QALY_pfs_comp  -0.654500671 -0.512439160  0.006902301   NA  0.0214730760
## QALY_pfs_int   -0.549222875 -0.586905726  0.008112931   NA  0.0171669167
## QALY_pd_comp    0.375702865 -0.386783403 -0.587595960   NA -0.0110607234
## QALY_pd_int     0.418231668 -0.417503190 -0.556967617   NA -0.0111641731
## Costs_pfs_comp -0.517922376 -0.398979866  0.017393108   NA  0.0271816605
## Costs_pfs_int  -0.432907373 -0.454522708  0.018085751   NA  0.0234514984
## Costs_pd_comp   0.410239692 -0.361052830 -0.523619933   NA -0.0152243661
## Costs_pd_int    0.451340245 -0.386885995 -0.496859767   NA -0.0155658632
## QALY_ae_int    -0.021395840 -0.008030030  0.005575349   NA  0.7638387333
## Costs_ae_int   -0.028186016 -0.011196075  0.002954918   NA  0.8947127396
## Inc_QALY        0.022910723 -0.658263698  0.219492682   NA -0.0209854183
## Inc_Costs      -0.589951222 -0.654208921  0.032212926   NA  0.0214839112
## NMB_int        -0.173925427 -0.702400474 -0.329586836   NA  0.0017138335
## NMB_comp       -0.252438721 -0.645074499 -0.382588528   NA  0.0090491828
## iNMB            0.425543468 -0.410619672  0.261710577   NA -0.0415087545
## NHB_int        -0.173925427 -0.702400474 -0.329586836   NA  0.0017138335
## NHB_comp       -0.252438721 -0.645074499 -0.382588528   NA  0.0090491828
## iNHB            0.425543468 -0.410619672  0.261710577   NA -0.0415087545
##                           rr         u_pfs         u_pd u_d          u_ae
## p_pfspd         0.0055556829 -0.0034370651 -0.008489360  NA  0.0042143104
## p_pfsd          0.0067082170  0.0097896297 -0.010290774  NA -0.0078459341
## p_pdd          -0.0057978835 -0.0167990741 -0.014401764  NA  0.0061153859
## p_dd                      NA            NA           NA  NA            NA
## p_ae            0.0076915659 -0.0114845290  0.004285824  NA -0.0207283208
## rr              1.0000000000 -0.0042278034 -0.005801696  NA -0.0230641212
## u_pfs          -0.0042278034  1.0000000000  0.021242759  NA  0.0135154016
## u_pd           -0.0058016960  0.0212427591  1.000000000  NA  0.0078137622
## u_d                       NA            NA           NA   1            NA
## u_ae           -0.0230641212  0.0135154016  0.007813762  NA  1.0000000000
## c_pfs          -0.0003802568  0.0034331149 -0.013308394  NA -0.0095889440
## c_pd           -0.0129604287 -0.0044320841  0.003942809  NA  0.0081048934
## c_d                       NA            NA           NA  NA            NA
## c_thx           0.0025409157 -0.0005669849  0.002582883  NA  0.0087207713
## c_ae           -0.0148876228 -0.0143081358  0.019011830  NA  0.0003062855
## QALY_comp      -0.0106044723  0.3051658443  0.417231300  NA  0.0065257281
## QALY_int       -0.1203932067  0.3281264437  0.338581898  NA  0.0070152853
## Costs_comp     -0.0080164419  0.0021469688  0.012035883  NA  0.0033489268
## Costs_int      -0.2224958657 -0.0012208423  0.017445333  NA  0.0092048271
## LY_pfs_comp    -0.0106464373 -0.0004380891  0.017015306  NA  0.0035062868
## LY_pfs_int     -0.2476888110 -0.0008526912  0.017018478  NA  0.0091352539
## LY_pd_comp      0.0006242195  0.0078932997  0.011755265  NA -0.0039704471
## LY_pd_int       0.1532903637  0.0056157536  0.010332369  NA -0.0063209525
## QALY_pfs_comp  -0.0125463028  0.3833317662  0.024688100  NA  0.0078832951
## QALY_pfs_int   -0.2293238499  0.3846774267  0.024563732  NA  0.0134075337
## QALY_pd_comp   -0.0015692807  0.0199359727  0.592502840  NA  0.0007816481
## QALY_pd_int     0.1223329075  0.0178180478  0.562837475  NA -0.0017737143
## Costs_pfs_comp -0.0072158573  0.0020768359  0.003403604  NA -0.0006867819
## Costs_pfs_int  -0.1770487072  0.0008503792  0.003555780  NA  0.0031960440
## Costs_pd_comp  -0.0049011391  0.0012340391  0.011405732  NA  0.0040635071
## Costs_pd_int    0.1320014993 -0.0008274771  0.010349008  NA  0.0012593845
## QALY_ae_int    -0.0050667196 -0.0003522583  0.005237896  NA  0.5756756227
## Costs_ae_int   -0.0013694561 -0.0150741011  0.012047203  NA -0.0185726440
## Inc_QALY       -0.5476431139  0.2573068852 -0.192098858  NA  0.0054952003
## Inc_Costs      -0.2423118653 -0.0018515678  0.016281261  NA  0.0093057642
## NMB_int        -0.1040427876  0.3606482743  0.369767049  NA  0.0065395447
## NMB_comp       -0.0105374619  0.3096639394  0.423125322  NA  0.0065290379
## iNMB           -0.5442864622  0.3333866845 -0.258898133  NA  0.0008475315
## NHB_int        -0.1040427876  0.3606482743  0.369767049  NA  0.0065395447
## NHB_comp       -0.0105374619  0.3096639394  0.423125322  NA  0.0065290379
## iNHB           -0.5442864622  0.3333866845 -0.258898133  NA  0.0008475315
##                        c_pfs          c_pd c_d         c_thx          c_ae
## p_pfspd        -0.0072407289 -6.491644e-03  NA -0.0095126002 -0.0047877153
## p_pfsd          0.0089220058 -1.989455e-03  NA  0.0032276026 -0.0209188544
## p_pdd           0.0076994700  4.018725e-03  NA -0.0069675286  0.0084065078
## p_dd                      NA            NA  NA            NA            NA
## p_ae            0.0116018262 -2.972565e-03  NA -0.0063313753 -0.0018542748
## rr             -0.0003802568 -1.296043e-02  NA  0.0025409157 -0.0148876228
## u_pfs           0.0034331149 -4.432084e-03  NA -0.0005669849 -0.0143081358
## u_pd           -0.0133083940  3.942809e-03  NA  0.0025828832  0.0190118301
## u_d                       NA            NA  NA            NA            NA
## u_ae           -0.0095889440  8.104893e-03  NA  0.0087207713  0.0003062855
## c_pfs           1.0000000000 -3.784204e-03  NA -0.0050909619 -0.0080850947
## c_pd           -0.0037842037  1.000000e+00  NA  0.0048944545  0.0043422450
## c_d                       NA            NA   1            NA            NA
## c_thx          -0.0050909619  4.894455e-03  NA  1.0000000000  0.0020771004
## c_ae           -0.0080850947  4.342245e-03  NA  0.0020771004  1.0000000000
## QALY_comp      -0.0103328331 -1.700198e-03  NA  0.0071735807  0.0140781774
## QALY_int       -0.0111028370 -1.333459e-03  NA  0.0052731230  0.0164898298
## Costs_comp      0.3244516667  5.803968e-01  NA  0.0048001642  0.0061741806
## Costs_int       0.0809921712  1.134037e-01  NA  0.0493347050  0.0191557990
## LY_pfs_comp    -0.0008634609  2.342358e-03  NA  0.0079975038  0.0150801585
## LY_pfs_int     -0.0036208336  3.642237e-03  NA  0.0061117234  0.0200928418
## LY_pd_comp     -0.0129396629 -7.345635e-03  NA  0.0023917651  0.0000297480
## LY_pd_int      -0.0129232078 -9.122194e-03  NA  0.0013972198 -0.0012860288
## QALY_pfs_comp   0.0006896915  8.130601e-05  NA  0.0071248409  0.0090326149
## QALY_pfs_int   -0.0023807954  1.373561e-03  NA  0.0051313266  0.0138616519
## QALY_pd_comp   -0.0161460818 -2.620310e-03  NA  0.0026034719  0.0107117232
## QALY_pd_int    -0.0161079734 -4.325842e-03  NA  0.0018436046  0.0088790778
## Costs_pfs_comp  0.6816126278  3.801856e-06  NA  0.0016889697  0.0052202124
## Costs_pfs_int   0.6871680839  5.014208e-04  NA  0.0007048179  0.0085247321
## Costs_pd_comp  -0.0138241597  6.394063e-01  NA  0.0043682617  0.0039585651
## Costs_pd_int   -0.0136432856  6.056054e-01  NA  0.0034311872  0.0017716105
## QALY_ae_int     0.0046730992  4.264632e-03  NA  0.0022570993 -0.0014572887
## Costs_ae_int    0.0086834700 -1.628790e-03  NA -0.0047865527  0.4086339889
## Inc_QALY       -0.0086755892  1.011375e-03  NA -0.0060124393  0.0185547912
## Inc_Costs       0.0116002464 -1.380224e-02  NA  0.0530084224  0.0195552966
## NMB_int        -0.0224728468 -1.585158e-02  NA -0.0004654132  0.0156862769
## NMB_comp       -0.0196105263 -1.804593e-02  NA  0.0071457601  0.0141148591
## iNMB           -0.0189848286  1.056945e-02  NA -0.0433398522  0.0108260896
## NHB_int        -0.0224728468 -1.585158e-02  NA -0.0004654132  0.0156862769
## NHB_comp       -0.0196105263 -1.804593e-02  NA  0.0071457601  0.0141148591
## iNHB           -0.0189848286  1.056945e-02  NA -0.0433398522  0.0108260896
##                   QALY_comp     QALY_int    Costs_comp    Costs_int
## p_pfspd        -0.245500974 -0.217456717  0.1163093629 -0.512223757
## p_pfsd         -0.650125556 -0.721315789 -0.5249928607 -0.709963006
## p_pdd          -0.389887645 -0.308303151 -0.4666951715 -0.071951283
## p_dd                     NA           NA            NA           NA
## p_ae            0.008905463  0.003810515 -0.0003802565  0.019490171
## rr             -0.010604472 -0.120393207 -0.0080164419 -0.222495866
## u_pfs           0.305165844  0.328126444  0.0021469688 -0.001220842
## u_pd            0.417231300  0.338581898  0.0120358828  0.017445333
## u_d                      NA           NA            NA           NA
## u_ae            0.006525728  0.007015285  0.0033489268  0.009204827
## c_pfs          -0.010332833 -0.011102837  0.3244516667  0.080992171
## c_pd           -0.001700198 -0.001333459  0.5803967986  0.113403674
## c_d                      NA           NA            NA           NA
## c_thx           0.007173581  0.005273123  0.0048001642  0.049334705
## c_ae            0.014078177  0.016489830  0.0061741806  0.019155799
## QALY_comp       1.000000000  0.982400906  0.5411687615  0.741374207
## QALY_int        0.982400906  1.000000000  0.5398056014  0.800382268
## Costs_comp      0.541168761  0.539805601  1.0000000000  0.500146369
## Costs_int       0.741374207  0.800382268  0.5001463687  1.000000000
## LY_pfs_comp     0.671168901  0.697024897  0.2696224941  0.931342125
## LY_pfs_int      0.689136462  0.752782745  0.3185562098  0.978429259
## LY_pd_comp      0.496858175  0.477808728  0.6508108326  0.159344105
## LY_pd_int       0.476246644  0.448443027  0.6375388448  0.116573619
## QALY_pfs_comp   0.740413173  0.773127377  0.2488181658  0.856203460
## QALY_pfs_int    0.756834925  0.824676125  0.2935596240  0.898731237
## QALY_pd_comp    0.649040236  0.585842899  0.5231299301  0.133396243
## QALY_pd_int     0.630761664  0.562662453  0.5253680045  0.101554809
## Costs_pfs_comp  0.473931987  0.491897218  0.4252605753  0.725948929
## Costs_pfs_int   0.483317391  0.527895966  0.4607747046  0.755646611
## Costs_pd_comp   0.338048099  0.326760945  0.8700413662  0.155584887
## Costs_pd_int    0.329894530  0.308841581  0.8532471533  0.115288800
## QALY_ae_int     0.010779190  0.006905744  0.0033046830  0.021221615
## Costs_ae_int    0.014057957  0.010393859  0.0024455215  0.024735324
## Inc_QALY        0.384302420  0.549979880  0.2483088922  0.641056119
## Inc_Costs       0.684833408  0.749928164  0.3107341346  0.978486645
## NMB_int         0.985254593  0.997103827  0.5296035134  0.752471610
## NMB_comp        0.999720397  0.981896744  0.5211332888  0.738384858
## iNMB            0.036422618  0.206596008  0.1119673252  0.170755425
## NHB_int         0.985254593  0.997103827  0.5296035134  0.752471610
## NHB_comp        0.999720397  0.981896744  0.5211332888  0.738384858
## iNHB            0.036422618  0.206596008  0.1119673252  0.170755425
##                  LY_pfs_comp    LY_pfs_int    LY_pd_comp    LY_pd_int
## p_pfspd        -0.7099454396 -0.5957086063  0.4783240876  0.518747045
## p_pfsd         -0.5622561662 -0.6437336425 -0.4832035731 -0.509285887
## p_pdd           0.0162564229  0.0176226364 -0.7320873719 -0.676112095
## p_dd                      NA            NA            NA           NA
## p_ae            0.0279916020  0.0232828300 -0.0145949890 -0.014277271
## rr             -0.0106464373 -0.2476888110  0.0006242195  0.153290364
## u_pfs          -0.0004380891 -0.0008526912  0.0078932997  0.005615754
## u_pd            0.0170153062  0.0170184780  0.0117552651  0.010332369
## u_d                       NA            NA            NA           NA
## u_ae            0.0035062868  0.0091352539 -0.0039704471 -0.006320953
## c_pfs          -0.0008634609 -0.0036208336 -0.0129396629 -0.012923208
## c_pd            0.0023423580  0.0036422372 -0.0073456350 -0.009122194
## c_d                       NA            NA            NA           NA
## c_thx           0.0079975038  0.0061117234  0.0023917651  0.001397220
## c_ae            0.0150801585  0.0200928418  0.0000297480 -0.001286029
## QALY_comp       0.6711689006  0.6891364621  0.4968581746  0.476246644
## QALY_int        0.6970248969  0.7527827446  0.4778087276  0.448443027
## Costs_comp      0.2696224941  0.3185562098  0.6508108326  0.637538845
## Costs_int       0.9313421251  0.9784292591  0.1593441047  0.116573619
## LY_pfs_comp     1.0000000000  0.9601524440 -0.0621798008 -0.078101001
## LY_pfs_int      0.9601524440  1.0000000000  0.0239455799 -0.022276390
## LY_pd_comp     -0.0621798008  0.0239455799  1.0000000000  0.984761501
## LY_pd_int      -0.0781010008 -0.0222763897  0.9847615007  1.000000000
## QALY_pfs_comp   0.9195089096  0.8829401022 -0.0537105754 -0.069545562
## QALY_pfs_int    0.8823532541  0.9188192983  0.0255439748 -0.017979886
## QALY_pd_comp   -0.0426530865  0.0254548920  0.7996453378  0.786917218
## QALY_pd_int    -0.0572350799 -0.0119590067  0.8074219246  0.819120214
## Costs_pfs_comp  0.7166648447  0.6859691250 -0.0540284664 -0.065238500
## Costs_pfs_int   0.6833798152  0.7095871179  0.0077634386 -0.025121514
## Costs_pd_comp  -0.0933204830 -0.0226919536  0.7464101972  0.737894726
## Costs_pd_int   -0.1094859168 -0.0654639981  0.7543471267  0.771756793
## QALY_ae_int     0.0242182692  0.0236321368 -0.0129430743 -0.013643401
## Costs_ae_int    0.0302275645  0.0284804549 -0.0121822544 -0.012843420
## Inc_QALY        0.4441107160  0.6393621083  0.1400090183  0.087026404
## Inc_Costs       0.9580468250  0.9980734031  0.0198479843 -0.023936837
## NMB_int         0.6476289488  0.7029132904  0.5047259271  0.477889482
## NMB_comp        0.6736130109  0.6904729854  0.4859797503  0.465433530
## iNMB           -0.0697520444  0.1554222838  0.1674085174  0.128403970
## NHB_int         0.6476289488  0.7029132904  0.5047259271  0.477889482
## NHB_comp        0.6736130109  0.6904729854  0.4859797503  0.465433530
## iNHB           -0.0697520444  0.1554222838  0.1674085174  0.128403970
##                QALY_pfs_comp QALY_pfs_int  QALY_pd_comp  QALY_pd_int
## p_pfspd        -6.545007e-01 -0.549222875  0.3757028652  0.418231668
## p_pfsd         -5.124392e-01 -0.586905726 -0.3867834032 -0.417503190
## p_pdd           6.902301e-03  0.008112931 -0.5875959604 -0.556967617
## p_dd                      NA           NA            NA           NA
## p_ae            2.147308e-02  0.017166917 -0.0110607234 -0.011164173
## rr             -1.254630e-02 -0.229323850 -0.0015692807  0.122332907
## u_pfs           3.833318e-01  0.384677427  0.0199359727  0.017818048
## u_pd            2.468810e-02  0.024563732  0.5925028397  0.562837475
## u_d                       NA           NA            NA           NA
## u_ae            7.883295e-03  0.013407534  0.0007816481 -0.001773714
## c_pfs           6.896915e-04 -0.002380795 -0.0161460818 -0.016107973
## c_pd            8.130601e-05  0.001373561 -0.0026203095 -0.004325842
## c_d                       NA           NA            NA           NA
## c_thx           7.124841e-03  0.005131327  0.0026034719  0.001843605
## c_ae            9.032615e-03  0.013861652  0.0107117232  0.008879078
## QALY_comp       7.404132e-01  0.756834925  0.6490402357  0.630761664
## QALY_int        7.731274e-01  0.824676125  0.5858428991  0.562662453
## Costs_comp      2.488182e-01  0.293559624  0.5231299301  0.525368005
## Costs_int       8.562035e-01  0.898731237  0.1333962428  0.101554809
## LY_pfs_comp     9.195089e-01  0.882353254 -0.0426530865 -0.057235080
## LY_pfs_int      8.829401e-01  0.918819298  0.0254548920 -0.011959007
## LY_pd_comp     -5.371058e-02  0.025543975  0.7996453378  0.807421925
## LY_pd_int      -6.954556e-02 -0.017979886  0.7869172178  0.819120214
## QALY_pfs_comp   1.000000e+00  0.966230347 -0.0307844497 -0.045310638
## QALY_pfs_int    9.662303e-01  1.000000000  0.0318566918 -0.003533728
## QALY_pd_comp   -3.078445e-02  0.031856692  1.0000000000  0.989259794
## QALY_pd_int    -4.531064e-02 -0.003533728  0.9892597940  1.000000000
## Costs_pfs_comp  6.598858e-01  0.630883629 -0.0421087357 -0.052332629
## Costs_pfs_int   6.289334e-01  0.652080986  0.0068804264 -0.019674005
## Costs_pd_comp  -8.531339e-02 -0.020225802  0.5992549034  0.607289336
## Costs_pd_int   -1.011601e-01 -0.060380510  0.6050656989  0.634292655
## QALY_ae_int     2.233839e-02  0.021915325 -0.0092537738 -0.010408393
## Costs_ae_int    2.249150e-02  0.020913681 -0.0045513547 -0.005761587
## Inc_QALY        5.106423e-01  0.692001538 -0.0064761485 -0.039318788
## Inc_Costs       8.805278e-01  0.916548587  0.0217863462 -0.013697509
## NMB_int         7.407705e-01  0.792008986  0.6267085643  0.605281019
## NMB_comp        7.444766e-01  0.759885591  0.6440253507  0.625410807
## iNMB            6.816011e-02  0.278090378 -0.0229824921 -0.041560929
## NHB_int         7.407705e-01  0.792008986  0.6267085643  0.605281019
## NHB_comp        7.444766e-01  0.759885591  0.6440253507  0.625410807
## iNHB            6.816011e-02  0.278090378 -0.0229824921 -0.041560929
##                Costs_pfs_comp Costs_pfs_int Costs_pd_comp  Costs_pd_int
## p_pfspd         -5.179224e-01 -0.4329073733   0.410239692  0.4513402453
## p_pfsd          -3.989799e-01 -0.4545227084  -0.361052830 -0.3868859950
## p_pdd            1.739311e-02  0.0180857511  -0.523619933 -0.4968597667
## p_dd                       NA            NA            NA            NA
## p_ae             2.718166e-02  0.0234514984  -0.015224366 -0.0155658632
## rr              -7.215857e-03 -0.1770487072  -0.004901139  0.1320014993
## u_pfs            2.076836e-03  0.0008503792   0.001234039 -0.0008274771
## u_pd             3.403604e-03  0.0035557805   0.011405732  0.0103490084
## u_d                        NA            NA            NA            NA
## u_ae            -6.867819e-04  0.0031960440   0.004063507  0.0012593845
## c_pfs            6.816126e-01  0.6871680839  -0.013824160 -0.0136432856
## c_pd             3.801856e-06  0.0005014208   0.639406277  0.6056054408
## c_d                        NA            NA            NA            NA
## c_thx            1.688970e-03  0.0007048179   0.004368262  0.0034311872
## c_ae             5.220212e-03  0.0085247321   0.003958565  0.0017716105
## QALY_comp        4.739320e-01  0.4833173908   0.338048099  0.3298945299
## QALY_int         4.918972e-01  0.5278959662   0.326760945  0.3088415812
## Costs_comp       4.252606e-01  0.4607747046   0.870041366  0.8532471533
## Costs_int        7.259489e-01  0.7556466109   0.155584887  0.1152888002
## LY_pfs_comp      7.166648e-01  0.6833798152  -0.093320483 -0.1094859168
## LY_pfs_int       6.859691e-01  0.7095871179  -0.022691954 -0.0654639981
## LY_pd_comp      -5.402847e-02  0.0077634386   0.746410197  0.7543471267
## LY_pd_int       -6.523850e-02 -0.0251215145   0.737894726  0.7717567931
## QALY_pfs_comp    6.598858e-01  0.6289333702  -0.085313393 -0.1011600941
## QALY_pfs_int     6.308836e-01  0.6520809862  -0.020225802 -0.0603805098
## QALY_pd_comp    -4.210874e-02  0.0068804264   0.599254903  0.6050656989
## QALY_pd_int     -5.233263e-02 -0.0196740055   0.607289336  0.6342926550
## Costs_pfs_comp   1.000000e+00  0.9787961748  -0.076186434 -0.0875724737
## Costs_pfs_int    9.787962e-01  1.0000000000  -0.025512015 -0.0559050692
## Costs_pd_comp   -7.618643e-02 -0.0255120148   1.000000000  0.9877000509
## Costs_pd_int    -8.757247e-02 -0.0559050692   0.987700051  1.0000000000
## QALY_ae_int      2.182615e-02  0.0211561192  -0.008247696 -0.0099460697
## Costs_ae_int     2.667734e-02  0.0251115748  -0.011836585 -0.0133970006
## Inc_QALY         3.121541e-01  0.4481173273   0.103529855  0.0514184380
## Inc_Costs        6.955170e-01  0.7196533213  -0.036509920 -0.0767395565
## NMB_int          4.483237e-01  0.4841058886   0.339255435  0.3246805051
## NMB_comp         4.690534e-01  0.4775803764   0.318632819  0.3108296960
## iNMB            -6.388055e-02  0.0954271583   0.158146332  0.1178801630
## NHB_int          4.483237e-01  0.4841058886   0.339255435  0.3246805051
## NHB_comp         4.690534e-01  0.4775803764   0.318632819  0.3108296960
## iNHB            -6.388055e-02  0.0954271583   0.158146332  0.1178801630
##                  QALY_ae_int Costs_ae_int     Inc_QALY    Inc_Costs
## p_pfspd        -0.0213958397 -0.028186016  0.022910723 -0.589951222
## p_pfsd         -0.0080300301 -0.011196075 -0.658263698 -0.654208921
## p_pdd           0.0055753487  0.002954918  0.219492682  0.032212926
## p_dd                      NA           NA           NA           NA
## p_ae            0.7638387333  0.894712740 -0.020985418  0.021483911
## rr             -0.0050667196 -0.001369456 -0.547643114 -0.242311865
## u_pfs          -0.0003522583 -0.015074101  0.257306885 -0.001851568
## u_pd            0.0052378960  0.012047203 -0.192098858  0.016281261
## u_d                       NA           NA           NA           NA
## u_ae            0.5756756227 -0.018572644  0.005495200  0.009305764
## c_pfs           0.0046730992  0.008683470 -0.008675589  0.011600246
## c_pd            0.0042646317 -0.001628790  0.001011375 -0.013802239
## c_d                       NA           NA           NA           NA
## c_thx           0.0022570993 -0.004786553 -0.006012439  0.053008422
## c_ae           -0.0014572887  0.408633989  0.018554791  0.019555297
## QALY_comp       0.0107791899  0.014057957  0.384302420  0.684833408
## QALY_int        0.0069057443  0.010393859  0.549979880  0.749928164
## Costs_comp      0.0033046830  0.002445522  0.248308892  0.310734135
## Costs_int       0.0212216147  0.024735324  0.641056119  0.978486645
## LY_pfs_comp     0.0242182692  0.030227565  0.444110716  0.958046825
## LY_pfs_int      0.0236321368  0.028480455  0.639362108  0.998073403
## LY_pd_comp     -0.0129430743 -0.012182254  0.140009018  0.019847984
## LY_pd_int      -0.0136434012 -0.012843420  0.087026404 -0.023936837
## QALY_pfs_comp   0.0223383932  0.022491495  0.510642327  0.880527767
## QALY_pfs_int    0.0219153249  0.020913681  0.692001538  0.916548587
## QALY_pd_comp   -0.0092537738 -0.004551355 -0.006476148  0.021786346
## QALY_pd_int    -0.0104083932 -0.005761587 -0.039318788 -0.013697509
## Costs_pfs_comp  0.0218261521  0.026677344  0.312154120  0.695516999
## Costs_pfs_int   0.0211561192  0.025111575  0.448117327  0.719653321
## Costs_pd_comp  -0.0082476962 -0.011836585  0.103529855 -0.036509920
## Costs_pd_int   -0.0099460697 -0.013397001  0.051418438 -0.076739556
## QALY_ae_int     1.0000000000  0.683080063 -0.014064912  0.022506489
## Costs_ae_int    0.6830800630  1.000000000 -0.011484943  0.026567994
## Inc_QALY       -0.0140649116 -0.011484943  1.000000000  0.644493402
## Inc_Costs       0.0225064886  0.026567994  0.644493402  1.000000000
## NMB_int         0.0048947280  0.008281160  0.522905346  0.699769850
## NMB_comp        0.0108472806  0.014199184  0.383060737  0.686325605
## iNMB           -0.0332617796 -0.032657474  0.858270055  0.160752889
## NHB_int         0.0048947280  0.008281160  0.522905346  0.699769850
## NHB_comp        0.0108472806  0.014199184  0.383060737  0.686325605
## iNHB           -0.0332617796 -0.032657474  0.858270055  0.160752889
##                      NMB_int     NMB_comp          iNMB       NHB_int
## p_pfspd        -0.1739254266 -0.252438721  0.4255434680 -0.1739254266
## p_pfsd         -0.7024004741 -0.645074499 -0.4106196716 -0.7024004741
## p_pdd          -0.3295868359 -0.382588528  0.2617105774 -0.3295868359
## p_dd                      NA           NA            NA            NA
## p_ae            0.0017138335  0.009049183 -0.0415087545  0.0017138335
## rr             -0.1040427876 -0.010537462 -0.5442864622 -0.1040427876
## u_pfs           0.3606482743  0.309663939  0.3333866845  0.3606482743
## u_pd            0.3697670492  0.423125322 -0.2588981328  0.3697670492
## u_d                       NA           NA            NA            NA
## u_ae            0.0065395447  0.006529038  0.0008475315  0.0065395447
## c_pfs          -0.0224728468 -0.019610526 -0.0189848286 -0.0224728468
## c_pd           -0.0158515799 -0.018045931  0.0105694518 -0.0158515799
## c_d                       NA           NA            NA            NA
## c_thx          -0.0004654132  0.007145760 -0.0433398522 -0.0004654132
## c_ae            0.0156862769  0.014114859  0.0108260896  0.0156862769
## QALY_comp       0.9852545927  0.999720397  0.0364226182  0.9852545927
## QALY_int        0.9971038273  0.981896744  0.2065960082  0.9971038273
## Costs_comp      0.5296035134  0.521133289  0.1119673252  0.5296035134
## Costs_int       0.7524716104  0.738384858  0.1707554245  0.7524716104
## LY_pfs_comp     0.6476289488  0.673613011 -0.0697520444  0.6476289488
## LY_pfs_int      0.7029132904  0.690472985  0.1554222838  0.7029132904
## LY_pd_comp      0.5047259271  0.485979750  0.1674085174  0.5047259271
## LY_pd_int       0.4778894817  0.465433530  0.1284039698  0.4778894817
## QALY_pfs_comp   0.7407705280  0.744476634  0.0681601128  0.7407705280
## QALY_pfs_int    0.7920089859  0.759885591  0.2780903780  0.7920089859
## QALY_pd_comp    0.6267085643  0.644025351 -0.0229824921  0.6267085643
## QALY_pd_int     0.6052810190  0.625410807 -0.0415609293  0.6052810190
## Costs_pfs_comp  0.4483236622  0.469053408 -0.0638805461  0.4483236622
## Costs_pfs_int   0.4841058886  0.477580376  0.0954271583  0.4841058886
## Costs_pd_comp   0.3392554347  0.318632819  0.1581463317  0.3392554347
## Costs_pd_int    0.3246805051  0.310829696  0.1178801630  0.3246805051
## QALY_ae_int     0.0048947280  0.010847281 -0.0332617796  0.0048947280
## Costs_ae_int    0.0082811605  0.014199184 -0.0326574742  0.0082811605
## Inc_QALY        0.5229053458  0.383060737  0.8582700552  0.5229053458
## Inc_Costs       0.6997698496  0.686325605  0.1607528895  0.6997698496
## NMB_int         1.0000000000  0.985079934  0.2053126624  1.0000000000
## NMB_comp        0.9850799339  1.000000000  0.0338182475  0.9850799339
## iNMB            0.2053126624  0.033818247  1.0000000000  0.2053126624
## NHB_int         1.0000000000  0.985079934  0.2053126624  1.0000000000
## NHB_comp        0.9850799339  1.000000000  0.0338182475  0.9850799339
## iNHB            0.2053126624  0.033818247  1.0000000000  0.2053126624
##                    NHB_comp          iNHB
## p_pfspd        -0.252438721  0.4255434680
## p_pfsd         -0.645074499 -0.4106196716
## p_pdd          -0.382588528  0.2617105774
## p_dd                     NA            NA
## p_ae            0.009049183 -0.0415087545
## rr             -0.010537462 -0.5442864622
## u_pfs           0.309663939  0.3333866845
## u_pd            0.423125322 -0.2588981328
## u_d                      NA            NA
## u_ae            0.006529038  0.0008475315
## c_pfs          -0.019610526 -0.0189848286
## c_pd           -0.018045931  0.0105694518
## c_d                      NA            NA
## c_thx           0.007145760 -0.0433398522
## c_ae            0.014114859  0.0108260896
## QALY_comp       0.999720397  0.0364226182
## QALY_int        0.981896744  0.2065960082
## Costs_comp      0.521133289  0.1119673252
## Costs_int       0.738384858  0.1707554245
## LY_pfs_comp     0.673613011 -0.0697520444
## LY_pfs_int      0.690472985  0.1554222838
## LY_pd_comp      0.485979750  0.1674085174
## LY_pd_int       0.465433530  0.1284039698
## QALY_pfs_comp   0.744476634  0.0681601128
## QALY_pfs_int    0.759885591  0.2780903780
## QALY_pd_comp    0.644025351 -0.0229824921
## QALY_pd_int     0.625410807 -0.0415609293
## Costs_pfs_comp  0.469053408 -0.0638805461
## Costs_pfs_int   0.477580376  0.0954271583
## Costs_pd_comp   0.318632819  0.1581463317
## Costs_pd_int    0.310829696  0.1178801630
## QALY_ae_int     0.010847281 -0.0332617796
## Costs_ae_int    0.014199184 -0.0326574742
## Inc_QALY        0.383060737  0.8582700552
## Inc_Costs       0.686325605  0.1607528895
## NMB_int         0.985079934  0.2053126624
## NMB_comp        1.000000000  0.0338182475
## iNMB            0.033818247  1.0000000000
## NHB_int         0.985079934  0.2053126624
## NHB_comp        1.000000000  0.0338182475
## iNHB            0.033818247  1.0000000000

c. Inspect types of variables

Positive variables

Are these variables strictly positive?

check_positive("c_pfs", "c_pd", df = df_pa)
##   Input Negative_values
## 1 c_pfs            None
## 2  c_pd            None

Variables between 0-1

Are these variables strictly positive?

check_binary("u_pfs", "p_pfspd", df = df_pa)
##     Input Negative_values Values_above_1
## 1   u_pfs            None           None
## 2 p_pfspd            None           None

Sum of probabilities

To check whether the sum is lower than or equal to, or equal to 1

check_sum_probs("p_pfspd", "p_pfsd", df = df_pa, check = "lower") # output is a text
## [1] "The sum of probabilities in all iterations is lower or equal to 1"

d. Histogram, density distribution of (user-selected) model inputs and outputs

To visually investigate the parameter distributions

Single parameter

p_1 <- vis_1_param(df = df_pa,
            param = "u_pfs",
            binwidth = NULL,
            type = "histogram",
            dist = c("norm", "beta", "gamma", "lnorm"))
## Loading required package: fitdistrplus
## Loading required package: MASS
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:plotly':
## 
##     select
## Loading required package: survival
p_1
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

paste("Probability to be in user-defined range: ",
      check_range(df_pa,
                  outcome = "u_pfs",
                  min_val = 0.77,
                  max_val = 0.80
                  ), "%") # add this to plot? + lines of min/ max on plot?
## [1] "Probability to be in user-defined range:  16 %"

Two parameters

p_2p <- vis_2_params(df = df_pa,
                     param_1 = "u_pfs",
                     param_2 = "u_pd",
                     slope = 1,
                     check = "param_2 > param_1")
## [1] "P(TRUE): 5 %"
p_2p

e. Possibility to fit user-selected distributions (beta, gamma, lognormal, normal) + visualisation + parameters of the fitted distribution.

To cross check with parameters reported in documentation/report/ journal article, as an implementation check
- To do XP: Add probabilistic mean value per distribution

p_2 <- vis_1_param(df = df_pa,
            param = "u_pfs",
            binwidth = NULL,
            type = "density",
            dist = c("norm", "beta", "gamma", "lnorm"),
            user_dist = "beta",
            user_param_1 = 0.8,
            user_param_2 = 0.2,
            user_mean = 0.75)
p_2
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Distributions’ parameters & statistical fit

l_dist <- fit_dist(df = df_pa,
                   param = "u_pfs",
                   dist = c("norm", "beta", "gamma", "lnorm"))
l_dist[[1]]
##   Distribution    AIC
## 1         norm -24724
## 2         beta -24980
## 3        gamma -24445
## 4        lnorm -24259
l_dist[[2]]
##   Distribution Name_param_1 Value_param_1 Name_param_2 Value_param_2
## 1         norm         mean          0.75           sd          0.07
## 2         beta       shape1          27.7       shape2          9.23
## 3        gamma        shape        110.13         rate        146.82
## 4        lnorm      meanlog         -0.29        sdlog           0.1

3. Investigate model outputs

a. Incremental cost-effectiveness plane & summary

Questions met Karel te bespreken:
- Interactive plot where you can click on a dot, or select some dots and see which input parameters combination has led to these outputs –> ook mogelijkheid om een bepaalde ‘gebied’ te selecteren (invoeren) en te zien welke inputs daarbij behoren.
- Combineren van de plot hierbeneden met de histogrammen van de waarden op de x en y as, of als niet overzichtelijk: met ticks op de axes als er een datapunt is.

p_3 <- plot_ice(df = df_pa,
                param_1 = "Inc_QALY",
                param_2 = "Inc_Costs",
                wtp = 80000)
p_3

p_3_interact <- ggplotly(p_3)
p_3_interact
summary_ice(df_pa,
           "Inc_QALY",
           "Inc_Costs")
##                                     Quadrant Percentage
## 1 NorthEast (more effective, more expensive)        99%
## 2 SouthEast (more effective, less expensive)         0%
## 3 NorthWest (less effective, more expensive)         1%
## 4 SouthWest (less effective, less expensive)         0%
  • Plot hierboven koppelen aan een graphs van 1 en 2 input parameters. Al gedaan in tentative shiny app voor onderwijs: selectie van punten in de ‘input graph’ wordt gehighlight in andere plot. Voorbeeld, laatste tabs van volgende shiny app: shiny::runGitHub("Teaching", "Xa4P", subdir = "Basics/shiny_app_cea/", ref = "main").

b. Cost-effectiveness acceptability curve.

df_ceac <- calculate_ceac(df = df_pa,
                     e_int = "QALY_int",
                     e_comp = "QALY_comp",
                     c_int = "Costs_int",
                     c_comp = "Costs_comp")

plot_ceac(df = df_ceac,
          wtp = "WTP_threshold")
## Loading required package: reshape2
## Loading required package: scales

df_ceac
##     WTP_threshold Prob_int Prob_comp
## 1               0   0.0000    1.0000
## 2            1000   0.0000    1.0000
## 3            2000   0.0000    1.0000
## 4            3000   0.0000    1.0000
## 5            4000   0.0000    1.0000
## 6            5000   0.0000    1.0000
## 7            6000   0.0000    1.0000
## 8            7000   0.0000    1.0000
## 9            8000   0.0000    1.0000
## 10           9000   0.0000    1.0000
## 11          10000   0.0000    1.0000
## 12          11000   0.0000    1.0000
## 13          12000   0.0000    1.0000
## 14          13000   0.0000    1.0000
## 15          14000   0.0000    1.0000
## 16          15000   0.0000    1.0000
## 17          16000   0.0000    1.0000
## 18          17000   0.0000    1.0000
## 19          18000   0.0000    1.0000
## 20          19000   0.0000    1.0000
## 21          20000   0.0000    1.0000
## 22          21000   0.0000    1.0000
## 23          22000   0.0000    1.0000
## 24          23000   0.0000    1.0000
## 25          24000   0.0000    1.0000
## 26          25000   0.0000    1.0000
## 27          26000   0.0000    1.0000
## 28          27000   0.0000    1.0000
## 29          28000   0.0000    1.0000
## 30          29000   0.0000    1.0000
## 31          30000   0.0000    1.0000
## 32          31000   0.0000    1.0000
## 33          32000   0.0000    1.0000
## 34          33000   0.0000    1.0000
## 35          34000   0.0000    1.0000
## 36          35000   0.0000    1.0000
## 37          36000   0.0000    1.0000
## 38          37000   0.0000    1.0000
## 39          38000   0.0000    1.0000
## 40          39000   0.0000    1.0000
## 41          40000   0.0002    0.9998
## 42          41000   0.0005    0.9995
## 43          42000   0.0007    0.9993
## 44          43000   0.0007    0.9993
## 45          44000   0.0011    0.9989
## 46          45000   0.0015    0.9985
## 47          46000   0.0017    0.9983
## 48          47000   0.0025    0.9975
## 49          48000   0.0029    0.9971
## 50          49000   0.0043    0.9957
## 51          50000   0.0052    0.9948
## 52          51000   0.0069    0.9931
## 53          52000   0.0089    0.9911
## 54          53000   0.0102    0.9898
## 55          54000   0.0116    0.9884
## 56          55000   0.0136    0.9864
## 57          56000   0.0161    0.9839
## 58          57000   0.0182    0.9818
## 59          58000   0.0200    0.9800
## 60          59000   0.0236    0.9764
## 61          60000   0.0270    0.9730
## 62          61000   0.0299    0.9701
## 63          62000   0.0337    0.9663
## 64          63000   0.0382    0.9618
## 65          64000   0.0423    0.9577
## 66          65000   0.0471    0.9529
## 67          66000   0.0530    0.9470
## 68          67000   0.0585    0.9415
## 69          68000   0.0650    0.9350
## 70          69000   0.0711    0.9289
## 71          70000   0.0766    0.9234
## 72          71000   0.0816    0.9184
## 73          72000   0.0869    0.9131
## 74          73000   0.0934    0.9066
## 75          74000   0.1004    0.8996
## 76          75000   0.1071    0.8929
## 77          76000   0.1135    0.8865
## 78          77000   0.1192    0.8808
## 79          78000   0.1261    0.8739
## 80          79000   0.1332    0.8668
## 81          80000   0.1409    0.8591
## 82          81000   0.1483    0.8517
## 83          82000   0.1546    0.8454
## 84          83000   0.1619    0.8381
## 85          84000   0.1697    0.8303
## 86          85000   0.1764    0.8236
## 87          86000   0.1846    0.8154
## 88          87000   0.1918    0.8082
## 89          88000   0.2007    0.7993
## 90          89000   0.2098    0.7902
## 91          90000   0.2186    0.7814
## 92          91000   0.2262    0.7738
## 93          92000   0.2338    0.7662
## 94          93000   0.2418    0.7582
## 95          94000   0.2496    0.7504
## 96          95000   0.2576    0.7424
## 97          96000   0.2652    0.7348
## 98          97000   0.2742    0.7258
## 99          98000   0.2829    0.7171
## 100         99000   0.2902    0.7098
## 101        100000   0.2976    0.7024

c. Histogram and density distribution of total and incremental costs and effects.

Can use the function above!

###d. Convergence graph of outcomes

plot_convergence(df = df_pa,
                 outcome = "iNMB"
                 )

4. Investigate relation between inputs and outputs

Single

  • To do XP: Add R2
lm_rr <- fit_lm_metamodel(df = df_pa,
                          x = "rr",
                          y = "iNMB")
lm_pred <- unlist(predict(lm_rr, data.frame(rr = df_pa$rr)))
df_obs_pred <- data.frame(
  Values = df_pa$rr,
  Observed = df_pa$iNMB,
  Predicted = lm_pred
)
ggplot(data = df_obs_pred, aes(x = Values, y = Observed)) +
  geom_point(shape = 1, colour = "lightgrey") +
  geom_smooth(method = "lm") +
  theme_bw()
## `geom_smooth()` using formula 'y ~ x'

plot(lm_rr)

Multiple

  • To do XP: Add R2
lm_full <- fit_lm_metamodel(df = df_pa,
                          x = c("rr", "u_pfs", "u_pd", "c_pfs", "c_pd", "c_thx", "p_pfspd", "p_pfsd", "p_pdd"),
                          y = "iNMB")
lm_pred_full <- predict(lm_full, data.frame(rr = df_pa$rr,
                            u_pfs = mean(df_pa$u_pfs),
                            u_pd = mean(df_pa$u_pd),
                            c_pfs = mean(df_pa$c_pfs),
                            c_pd = mean(df_pa$c_pd),
                            c_thx = mean(df_pa$c_thx),
                            p_pfspd = mean(df_pa$p_pfspd),
                            p_pfsd = mean(df_pa$p_pfsd),
                            p_pdd = mean(df_pa$p_pdd)))

df_obs_pred_full <- data.frame(
  Values = df_pa$rr,
  Observed = df_pa$iNMB,
  Predicted = lm_pred_full
)

ggplot(data = df_obs_pred_full, aes(x = Values, y = Observed)) +
  geom_point(shape = 1, colour = "lightgrey") +
  geom_line(data = df_obs_pred_full, aes(x = Values, y = Predicted), colour = "blue") +
  theme_bw()

plot(lm_full)

df_dsa <- dsa_lm_metamodel(df = df_pa,
                           lm_metamodel = lm_full)
plot_tornado(df = df_dsa,
             df_basecase = df_pa,
             outcome = "iNMB")
## Loading required package: tidyverse
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v tibble  3.0.5     v dplyr   1.0.3
## v tidyr   1.1.2     v stringr 1.4.0
## v readr   1.4.0     v forcats 0.5.1
## v purrr   0.3.4
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x readr::col_factor() masks scales::col_factor()
## x purrr::discard()    masks scales::discard()
## x dplyr::filter()     masks plotly::filter(), stats::filter()
## x dplyr::lag()        masks stats::lag()
## x dplyr::select()     masks MASS::select(), plotly::select()

5. Add predictions based on metamodel

Other activities/ questions/ to do’s

  • Two-way sensitivity analysis based on metamodel.
  • Include other functional forms of metamodels
  • Include predictions of outcome based on metamodels
  • Check results of deterministic sensitivity analyses using original model and metamodel.
  • XP to do: Add possibility of having multiple scenarios loaded.
  • Shapley values, zou dat kunnen ? Zou het mogelijk zijn om dat op de originele data set te doen? KernelExplainer on this github: https://github.com/slundberg/shap. Of is dit iets? https://github.com/nredell/shapFlex, maar ziet eruit dat je ook een model moet fitten (niet model agnostic)
  • Check whether violin plot have added value
  • KAREL: voor selectie variabelen voor de verschillende functies: gebruik van buttons lijkt me het handigste, wat denk jij?
  • KAREL: is het mogelijk om groepen van variabelen te ‘labellen’ (dus alle kosten, utiliteiten, probabiliteiten) en dat de Shiny App het als ‘groep’ ziet en dus dat bepaalde functies (semi-automatisch) uitgevoerd worden op deze groepen variabelen?